﻿using CPPEI.Coolzon.Common;
using CPPEI.Coolzon.Server.CacheData;
using CPPEI.Coolzon.ServiceImp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.Coolzon.Server
{
    public class EventReceiver
    {
        [Subscribe]
        public void BeginPublishSolution(BeginPublishSolution @event)
        {
            ServerData.IsUpdatingSolution = true;
        }
        [Subscribe]
        public void EndPublishSolution(EndPublishSolution @event)
        {
            if (@event.IsSuccess)
            {
                Program.LoadSolutions();
                Program.VerifySolutions();
            }
            ServerData.IsUpdatingSolution = false;
        }
    }
}
